/** 全局指令示例 */
import Vue from 'vue'
Vue.directive('focus', {
  inserted(el) { el.focus() }
})
Vue.directive('permission', {
  bind(el, binding, vnode) {
    const authed = vnode.context.$store.getters['auth/isAuthenticated']
    if (!authed && binding.value === 'protected') el.style.display = 'none'
  }
})

